package File;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;

public class Demo2 {
    public static void main(String[] args) {
        try(OutputStream outputStream = new FileOutputStream("test2.txt")) {
            PrintWriter printWriter = new PrintWriter(outputStream);
            //printWriter用法就如sout 是一样的
            printWriter.println("hello");
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
